<!DOCTYPE html>
<html>
	<head>
		 <meta http-equiv="refresh" content="86400">
		 	<title>Mail更新监视后台程序</title>
	</head>
	<body>
<?php
	include 'inc/conn.php';
	include 'sendmail.php';

	extract($_POST);
	extract($_GET);
	unset($_POST,$_GET);

	$db = new mysql();
	$db->query("select * from mail_tracking where `status`='Open'");
	$num = $db->db_num_rows();

	for($ii=0; $ii<$num; $ii++){
		$row = $db->fetch_assoc();

		$result="<br /><b>【问题追踪】：</b>${row['title']} <b>个</b>，<b>内容：</b><font color='blue'>".htmlspecialchars_decode($row['content'])."</font> ，<b>发送给：</b><font color='red'>${row['sendto']}</font><br />";

		echo $result;

		if(isset($mail) && $mail==1){  // only sent mail
			SendMail("【问题追踪】${row['title']}", htmlspecialchars_decode($row['content']), $row['sendto']);
		}
	}
	$db->close();
	ftp_close($conn);
?>
	</body>
</html>